<template>
    <div>
        <h1 @click="jump">组件内守卫</h1>
    </div>
</template>
<script>
export default {
    name:'email',
    methods: {
        jump(){
            this.$router.push({
                name:'contant',
                params:{
                    id:23
                }
            })
        }
    },
    beforeRouteEnter (to, from, next) {
        console.log('组件内守卫===>to',to);
        console.log('组件内守卫===>from',from);
        next();
    },
    beforeRouteUpdate(to, from, next) {
        console.log('参数变化守卫to===>',to);
        console.log('参数变化守卫from===>',from);
        next();
    },
    beforeRouteLeave (to, from, next) {
       console.log('离开守卫===>to',to);
        console.log('离开守卫===>from',from);
        next();
    },
}
</script>
<style lang="scss">
    
</style>